# k8s-tools Dockerfile gitlab打包工具镜像创建
FROM alpine:3.19

# 使用阿里云镜像源
RUN echo "https://mirrors.aliyun.com/alpine/v3.19/main" > /etc/apk/repositories && \
    echo "https://mirrors.aliyun.com/alpine/v3.19/community" >> /etc/apk/repositories

# 检测宿主机是否安装k3s (构建时参数)
ARG K3S_INSTALLED=false

# 安装基础工具 (始终安装)
RUN apk update && \
    apk add --no-cache \
    bash \
    curl \
    jq \
    gettext \
    gettext-envsubst \
    kubectl=1.28.4-r3 \
    coreutils

# 修复关键点：设置正确的入口点
ENTRYPOINT ["/bin/bash", "-c"]